const express = require('express')
const router =  express.Router()



// 导入用户路由对应的处理函数模块
const activity_handler = require('../router_handler/activity')
const expressJoi = require('@escook/express-joi')
const {add_activity_schema,
       delete_activity_schema,
       update_activity_schema,
       get_news_schema
    } = require('../schema/activity')

//活动浏览
router.get('/activitylist',activity_handler.getActivityList)
// 待审批活动浏览
router.get('/activityexa',activity_handler.getActivityByExa)

router.get('/activityexapase/:activityId',expressJoi(delete_activity_schema),activity_handler.goActivityByExa)
//活动增加
router.post('/add',expressJoi(add_activity_schema),activity_handler.addActivity)
//活动删除
router.get('/delete/:activityId',expressJoi(delete_activity_schema),activity_handler.deleteActivity)
//活动修改
router.post('/update',activity_handler.updateActivityById)
//活动查询
router.get('/activitylist/:activityTitle',activity_handler.getActivityById)


module.exports = router